﻿using System;
using System.Runtime.Serialization;

namespace GameBoard
{
    [DataContract]
    public class BoardInfo
    {
        [DataMember] internal string BoardImageName;

        [DataMember]
        public double DefinedBoardHeight { get; internal set; }

        [DataMember]
        public double DefinedBoardWidth { get; internal set; }

        [DataMember]
        public double BoardHillValue { get; internal set; }

        [DataMember] 
        internal bool MaintainRatio;

        [DataMember]
        public byte[] NoisePermutations { get; internal set; }
        
        Random _random = new Random();

        public BoardInfo(string newImage, double definedBoardHeight, double definedBoardWidth, double boardHillHeight, bool maintainRatio, byte [] hillNoise)
        {
            this.BoardImageName = newImage;
            this.DefinedBoardHeight = definedBoardHeight;
            this.DefinedBoardWidth = definedBoardWidth;
            this.MaintainRatio = maintainRatio;
            this.BoardHillValue = boardHillHeight;
            if (hillNoise == null)
            {
                NoisePermutations = new byte[512];
                _random.NextBytes(NoisePermutations);
            }
            else
            {
                NoisePermutations = hillNoise;
            }
            
        }


        
    }
}